<?php
use_helper('I18N');
?>
<script type="text/javascript" language="javascript">
    $(function($) {
        //$('#dgAnnouncement').modal('show');

        $(".pager_button").click(function(event){
            event.preventDefault();
            var pager = $(this).attr("ref");

            $(".page_content").hide(500);
            $("#page_" + pager).show(500);
        });
    }); // end function
</script>
<div class="row">
    <div class="col-md-12">
        <h2 class="page-title"><?php echo __("Account Summary"); ?>
            <small></small>
        </h2>
    </div>
</div>
<div class="row">
    <div class="col-md-7">
        <section class="widget">
            <header>
                <h4>
                    <i class="icon-ok-sign"></i>
                    <?php echo __("Membership Summary"); ?>
                    <small></small>
                </h4>
            </header>
            <div class="body">
                <form class="form-horizontal label-left" method="post"
                      action="#"
                      data-validate="parsley"
                      id="topupForm" name="topupForm">
                <fieldset>
                    <legend class="section">
                    <?php echo __("Membership Summary")?>
                    </legend>
                    <?php include_component('component', 'alert', array('param' => $sf_user->getAttribute(Globals::SESSION_DISTID, 0))) ?>
                    <div class="row">
                        <div class="col-sm-8">
                            <div class="control-group">
                                <label class="control-label" for="memberId">
                                <?php echo __("Member ID")?>
                                </label>

                                <div class="controls form-group">
                                    <input type="text" readonly="readonly" id="memberId" name="memberId" class="form-control" value="<?php echo $distributor->getDistributorCode();?>">
                                </div>
                            </div>

                            <div class="control-group">
                                <label class="control-label" for="status">
                                <?php echo __("Status")?>
                                </label>

                                <div class="controls form-group">
                                    <input type="text" readonly="readonly" id="status" name="status" class="form-control" value="<?php echo $distributor->getStatusCode();?>">
                                </div>
                            </div>
                            <div class="control-group">
                                <label class="control-label" for="lastLogin">
                                <?php echo __("Last Login")?>
                                </label>

                                <div class="controls form-group">
                                    <input type="text" readonly="readonly" id="lastLogin" name="lastLogin" value="<?php echo $lastLogin;?>" class="form-control">
                                </div>
                            </div>
                        </div>
                    </div>
                </fieldset>
                </form>
            </div>
        </section>
    </div>
    <div class="col-md-5">
        <section class="widget">
            <header>
                <h4>
                    <i class="icon-ok-sign"></i>
                    <?php echo __("MT4 List"); ?>
                    <small></small>
                </h4>
            </header>
            <div class="body">
                <form class="form-horizontal label-left" method="post"
                      action="#"
                      data-validate="parsley"
                      id="topupForm2" name="topupForm2">
                <fieldset>
                    <legend class="section">
                    <?php echo __("MT4 List")?>
                    </legend>
                    <div class="row">
                        <div class="col-sm-12">
                            <table class="table table-bordered table-striped">
                                <thead>
                                <tr>
                                    <th>#</th>
                                    <th align="center"><?php echo __('MT4 Type') ?></th>
                                    <th align="center"><?php echo __('MT4 ID') ?></th>
                                    <th align="center"><?php echo __('Password') ?></th>
                                </tr>
                                </thead>
                                <tbody>
                                    <?php
                                        if (count($distMt4s) > 0) {
                                            $idx = 1;
                                            foreach ($distMt4s as $distMt4) {
                                                echo "<tr>
                                                    <td align='left'>" . $idx++ . "</td>
                                                    <td align='left'>Self Trading Account</td>
                                                    <td align='center'><span class='label label-success'>" . $distMt4->getMt4Username() . "</span></td>
                                                    <td align='center'>" . $distMt4->getMt4Password() . "</td>
                                                </tr>";
                                            }
                                        } else {
                                            echo "<tr class='odd' align='center'><td colspan='4'>" . __('No data available in table') . "</td></tr>";
                                        }
                                    ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </fieldset>
                </form>
            </div>
        </section>
    </div>
</div>

<div id="dgAnnouncement" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="false" style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content">

            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
                <h4 class="modal-title" id="myModalLabel2"><?php echo __('Announcement') ?></h4>
            </div>
            <div class="modal-body">
                <div class="row margin-bottom text-align-center">
                    <div class="col-md-12">
                        <div class="btn-group">
                            <button class="btn btn-info pager_button" type="button" data-original-title="" title="" ref="1">
                                1
                            </button>
                            <button class="btn btn-info pager_button" type="button" data-original-title="" title="" ref="2">
                                2
                            </button>
                            <button class="btn btn-info pager_button" type="button" data-original-title="" title="" ref="3">
                                3
                            </button>
                            <button class="btn btn-info pager_button" type="button" data-original-title="" title="" ref="4">
                                4
                            </button>
                        </div>
                        <div id="page_1" class="page_content">
                            <h4 style="font-weight: bold;">Scheduled Server Maintenance</h4>
                            <h5>10 January 2014</h5>
                            <p>Dear Valued Clients,</p>
                            <p>Date :12 January 2014
                                <br>Start : 00:00 GMT+8
                                <br>End : 23:59 GMT+8</p>

                            <p>Maintenance details :

                            <br>We are going to carry out an urgent maintenance to apply patches to server's operating system</p>

                            <p>Maintenance Effect :
                            <br>During the maintenance period, MT4 is inaccessible. This will not affect any user's setting and trading data.</p>
                            <p>Best Regards,
                            <br>Support Team</p>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div>